import Vue from 'vue'
import Router from 'vue-router'
import layout from '@/components/layout'

const user = resolve => require(['@/pages/sysManage/userManage'], resolve)
const user2 = resolve => require(['@/pages/sysManage/userManage2'], resolve)
const group = resolve => require(['@/pages/sysManage/groupList'], resolve)
const role = resolve => require(['@/pages/sysManage/roleManage'], resolve)
const log = resolve => require(['@/pages/sysManage/sysLog'], resolve)
const login = resolve => require(['@/pages/signin/login'], resolve)
const epLogin = resolve => require(['@/pages/signin/enterpriseLogin'], resolve)
const addUser = resolve => require(['@/pages/sysManage/addUser'], resolve)
const editUser = resolve => require(['@/pages/sysManage/editUser'], resolve)
const tagManage = resolve => require(['@/pages/customer/tagsManage'], resolve)
const customers = resolve => require(['@/pages/customer/customerList'], resolve)
const intention = resolve => require(['@/pages/customer/intentionCustomer'], resolve)
const cusDetail = resolve => require(['@/pages/customer/customerDetail'], resolve)
const cusOrderDetail = resolve => require(['@/pages/customer/customerOrderDetail'], resolve)
const curGroups = resolve => require(['@/pages/customer/curGroups'], resolve)
const oldGroups = resolve => require(['@/pages/customer/oldGroups'], resolve)
const editGroup = resolve => require(['@/pages/customer/cusGroupEdit'], resolve)
const oldGroupDetail = resolve => require(['@/pages/customer/oldGroupDetail'], resolve)
const contSource = resolve => require(['@/pages/content/source'], resolve)
const wechatList = resolve => require(['@/pages/content/weMedia/wechatList'], resolve)
const weiboList = resolve => require(['@/pages/content/weMedia/weiboList'], resolve)
const weiboAuth = resolve => require(['@/pages/content/weMedia/weiboAuth'], resolve)
const weiboManage = resolve => require(['@/pages/content/weMedia/weiboManage'], resolve)
const msgMail = resolve => require(['@/pages/content/weMedia/msgMail'], resolve)
const authSuccess = resolve => require(['@/pages/content/weMedia/authSuccess'], resolve)
const wechatManage = resolve => require(['@/pages/content/weMedia/wechatManage'], resolve)
const myWxContent = resolve => require(['@/pages/content/content/myContentWx'], resolve)
const editPoster = resolve => require(['@/pages/content/content/poster/editPoster'], resolve)
const myPosterList = resolve => require(['@/pages/content/content/poster/myPosterList'], resolve)
const editWxContent = resolve => require(['@/pages/content/content/editWxContent'], resolve)
const myWeiboContent = resolve => require(['@/pages/content/content/myContentWeibo'], resolve)
const mySmsContent = resolve => require(['@/pages/content/content/myContentSms'], resolve)
const editSms = resolve => require(['@/pages/content/content/editSms'], resolve)
const myMailContent = resolve => require(['@/pages/content/content/myContentMail'], resolve)
const editMail = resolve => require(['@/pages/content/content/mailEdit'], resolve)
const viewMail = resolve => require(['@/pages/content/content/mailView'], resolve)
const myWePageContent = resolve => require(['@/pages/content/content/myContentWePage'], resolve)
const editWePage = resolve => require(['@/pages/content/content/wePage/page'], resolve)
const myFormContent = resolve => require(['@/pages/content/content/myContentForm'], resolve)
const editForm = resolve => require(['@/pages/content/content/form/editForm'], resolve)
const viewForm = resolve => require(['@/pages/content/content/form/formView'], resolve)
const contentTypeWx = resolve => require(['@/pages/content/content/contentTypeWx'], resolve)
const commonContentWx = resolve => require(['@/pages/content/content/commonContentWx'], resolve)
const commonContentWeibo = resolve => require(['@/pages/content/content/commonContentWeibo'], resolve)
const commonContentSms = resolve => require(['@/pages/content/content/commonContentSms'], resolve)
const commonContentMail = resolve => require(['@/pages/content/content/commonContentMail'], resolve)
const commonContentWePage = resolve => require(['@/pages/content/content/commonContentWePage'], resolve)
const commonContentPoster = resolve => require(['@/pages/content/content/poster/commonPosterList'], resolve)
const groupContentWx = resolve => require(['@/pages/content/content/groupContentWx'], resolve)
const groupContentWeibo = resolve => require(['@/pages/content/content/groupContentWeibo'], resolve)
const groupContentSms = resolve => require(['@/pages/content/content/groupContentSms'], resolve)
const groupContentMail = resolve => require(['@/pages/content/content/groupContentMail'], resolve)
const groupContentWePage = resolve => require(['@/pages/content/content/groupContentWePage'], resolve)
const groupContentPoster = resolve => require(['@/pages/content/content/poster/groupPosterList'], resolve)
const releaseCheck = resolve => require(['@/pages/content/releaseCheck/waitCheck'], resolve)
const releaseChecked = resolve => require(['@/pages/content/releaseCheck/isChecked'], resolve)
const ActiveController = resolve => require(['@/pages/ActiveController/ActiveController'], resolve)
const TabFirst = resolve => require(['@/pages/ActiveController/Tab/TabFirst'], resolve)
const TabSecond = resolve => require(['@/pages/ActiveController/Tab/TabSecond'], resolve)
const TabThird = resolve => require(['@/pages/ActiveController/Tab/TabThird'], resolve)
const TabFourth = resolve => require(['@/pages/ActiveController/Tab/TabFourth'], resolve)
const TabFifth = resolve => require(['@/pages/ActiveController/Tab/TabFifth'], resolve)
const marketingCampaign = resolve => require(['@/pages/marketing/campaign'], resolve)
const campaignDetail = resolve => require(['@/pages/marketing/campaignDetail'], resolve)
const newCampaign = resolve => require(['@/pages/marketing/campaignDetail'], resolve)
const campaignReport = resolve => require(['@/pages/marketing/campaignReport'], resolve)
const campaignNewReport = resolve => require(['@/pages/marketing/campaignNewReport'], resolve)
const wxCardManage = resolve => require(['@/pages/marketing/WxCard/cardManage'], resolve)
const newWxCashCard = resolve => require(['@/pages/marketing/WxCard/newWxCard'], resolve)
const editWxCashCard = resolve => require(['@/pages/marketing/WxCard/editWxCard'], resolve)
const newWxGiftCard = resolve => require(['@/pages/marketing/WxCard/newWxCard'], resolve)
const editWxGiftCard = resolve => require(['@/pages/marketing/WxCard/editWxCard'], resolve)
const newWxCouponCard = resolve => require(['@/pages/marketing/WxCard/newWxCard'], resolve)
const editWxCouponCard = resolve => require(['@/pages/marketing/WxCard/editWxCard'], resolve)
const disparageList = resolve => require(['@/pages/marketing/disparageManage/list'], resolve)
const disparageDetails = resolve => require(['@/pages/marketing/disparageManage/details'], resolve)
const npsReportsList = resolve => require(['@/pages/marketing/disparageManage/npsReports/reportsList'], resolve)
const npsReportDetails = resolve => require(['@/pages/marketing/disparageManage/npsReports/reportDetails'], resolve)
const npsReportsOrdersList = resolve => require(['@/pages/marketing/disparageManage/npsReports/ordersList'], resolve)
const npsReportsOrderDetails = resolve => require(['@/pages/marketing/disparageManage/npsReports/orderDetails'], resolve)
const gmGroupsList = resolve => require(['@/pages/sysManage/groupsManage/groupsList'], resolve)
const gmEditGroup = resolve => require(['@/pages/sysManage/groupsManage/editGroup'], resolve)
const gmGroupMembers = resolve => require(['@/pages/sysManage/groupsManage/groupMembers'], resolve)

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/sys/login',
      name: 'Login',
      component: login
    }, {
      path: '/sys/eplogin',
      name: 'EPLogin',
      component: epLogin
    },
    {
      path: '/',
      component: layout,
      redirect: {name: 'User'},
      children: [{
        path: '/index',
        name: 'Index'
      }, {
        path: '/sys/user',
        name: 'User',
        component: user
      }, {
        path: '/sys/user2',
        name: 'User2',
        component: user2
      }, {
        path: '/sys/group',
        name: 'Group',
        meta: {keepAlive: true},
        component: group
      }, {
        path: '/sys/role',
        name: 'Role',
        meta: {keepAlive: true},
        component: role
      }, {
        path: '/sys/log',
        name: 'Log',
        component: log
      }, {
        path: '/sys/addUser',
        name: 'AddUser',
        component: addUser
      }, {
        path: '/sys/editUser/:uid',
        name: 'EditUser',
        component: editUser
      }, {
        path: '/sys/gm/groupsList',
        name: 'GmGroupsList',
        component: gmGroupsList
      }, {
        path: '/sys/gm/editGroup/:id',
        name: 'GmEditGroup',
        component: gmEditGroup
      }, {
        path: '/sys/gm/groupMembers/:id',
        name: 'GmGroupMembers',
        component: gmGroupMembers
      }, {
        path: '/cus/tagManage',
        name: 'TagManage',
        meta: {keepAlive: true},
        component: tagManage
      }, {
        path: '/cus/customers',
        name: 'Customers',
        component: customers
      }, {
        path: '/cus/intention',
        name: 'Intention',
        component: intention
      }, {
        path: '/cus/detail/:sid',
        name: 'CustomerDetail',
        component: cusDetail
      }, {
        path: '/cus/orderDetail/:sid',
        name: 'CustomerOrderDetail',
        component: cusOrderDetail
      }, {
        path: '/cus/curGroups',
        name: 'CurGroups',
        component: curGroups
      }, {
        path: '/cus/oldGroups',
        name: 'OldGroups',
        component: oldGroups
      }, {
        path: '/cus/group/edit/:gid',
        name: 'EditGroup',
        component: editGroup
      }, {
        path: '/cus/oldGroups/detail/:gid',
        name: 'OldGroupDetail',
        component: oldGroupDetail
      }, {
        path: '/cont/source/:type',
        name: 'ContentSource',
        component: contSource
      }, {
        path: '/cont/weMedia/wechatList',
        name: 'WechatList',
        component: wechatList
      }, {
        path: '/cont/weMedia/weiboList',
        name: 'weibo',
        component: weiboList
      }, {
        path: '/cont/weMedia/weiboAuth',
        name: 'WeiboAuth',
        component: weiboAuth
      }, {
        path: '/cont/weMedia/weiboManage/:type/:appid',
        name: 'WeiboManage',
        component: weiboManage
      }, {
        path: '/cont/weMedia/msgMail',
        name: 'msgMail',
        component: msgMail
      }, {
        path: '/cont/weMedia/authSuccess',
        name: 'AuthSuccess',
        component: authSuccess
      }, {
        path: '/cont/weMedia/wechatManage/:type/:appid',
        name: 'WechatManage',
        component: wechatManage
      }, {
        path: '/cont/myContent/wx',
        name: 'MyWxContent',
        component: myWxContent
      }, {
        path: '/marketing/campaign',
        name: 'MarketingCampaign',
        component: marketingCampaign
      }, {
        path: '/marketing/campaign/detail',
        name: 'NewCampaign',
        component: newCampaign
      }, {
        path: '/marketing/campaign/detail/:id',
        name: 'CampaignDetail',
        component: campaignDetail
      }, {
        path: '/marketing/campaign/report/:id',
        name: 'CampaignReport',
        component: campaignReport
      }, {
        path: '/marketing/campaign/newReport',
        name: 'CampaignNewReport',
        component: campaignNewReport
      }, {
        path: '/cont/myContent/wx/edit/:id',
        name: 'EditWxContent',
        meta: {keepAlive: true},
        component: editWxContent
      }, {
        path: '/marketing/wxCard/cardList',
        name: 'WxCardManage',
        component: wxCardManage
      }, {
        path: '/marketing/wxCard/new/cash',
        name: 'NewWxCashCard',
        component: newWxCashCard
      }, {
        path: '/marketing/wxCard/edit/cash/:id',
        name: 'EditWxCashCard',
        component: editWxCashCard
      }, {
        path: '/marketing/wxCard/edit/gift/:id',
        name: 'EditWxGiftCard',
        component: editWxGiftCard
      }, {
        path: '/marketing/wxCard/edit/coupon/:id',
        name: 'EditWxCouponCard',
        component: editWxCouponCard
      }, {
        path: '/marketing/wxCard/new/gift',
        name: 'NewWxGiftCard',
        component: newWxGiftCard
      }, {
        path: '/marketing/wxCard/new/coupon',
        name: 'NewWxCouponCard',
        component: newWxCouponCard
      }, {
        path: '/marketing/disparage/list',
        name: 'DisparageList',
        component: disparageList
      }, {
        path: '/marketing/disparage/details/:orderid',
        name: 'DisparageDetails',
        component: disparageDetails
      }, {
        path: '/marketing/disparage/reports/list',
        name: 'NpsReportsList',
        component: npsReportsList
      }, {
        path: '/marketing/disparage/reports/reportDetails/:id',
        name: 'NpsReportDetails',
        component: npsReportDetails
      }, {
        path: '/marketing/disparage/reports/orders',
        name: 'NpsReportsOrdersList',
        component: npsReportsOrdersList
      }, {
        path: '/marketing/disparage/reports/orderDetails/:id',
        name: 'NpsReportsOrderDetails',
        component: npsReportsOrderDetails
      }, {
        path: '/cont/myContent/weibo',
        name: 'MyWeiboContent',
        component: myWeiboContent
      }, {
        path: '/cont/myContent/sms',
        name: 'MySmsContent',
        component: mySmsContent
      }, {
        path: '/cont/myContent/editSms/:id',
        name: 'EditSms',
        component: editSms
      }, {
        path: '/cont/myContent/mail',
        name: 'MyMailContent',
        component: myMailContent
      }, {
        path: '/cont/myContent/editMail/:id/:mailId',
        name: 'EditMail',
        component: editMail
      }, {
        path: '/cont/myContent/viewMail/:id',
        name: 'ViewMail',
        component: viewMail
      }, {
        path: '/cont/myContent/editWePage/:id',
        name: 'WePage',
        component: editWePage
      }, {
        path: '/cont/myContent/wePage',
        name: 'MyWepageContent',
        component: myWePageContent
      }, {
        path: '/cont/myContent/form',
        name: 'MyFormContent',
        component: myFormContent
      }, {
        path: '/cont/myContent/editForm/:id',
        name: 'EditForm',
        component: editForm
      }, {
        path: '/cont/myContent/viewForm/:id',
        name: 'ViewForm',
        component: viewForm
      }, {
        path: '/cont/myContent/poster/edit/:id',
        name: 'EditPoster',
        component: editPoster
      }, {
        path: '/cont/myContent/poster/list',
        name: 'MyPosterList',
        component: myPosterList
      }, {
        path: '/cont/myContent/wx/type',
        name: 'ContentTypeWx',
        component: contentTypeWx
      }, {
        path: '/cont/commonContent/wx',
        name: 'CommonContentWx',
        component: commonContentWx
      }, {
        path: '/cont/commonContent/weibo',
        name: 'CommonContentWeibo',
        component: commonContentWeibo
      }, {
        path: '/cont/commonContent/sms',
        name: 'CommonContentSms',
        component: commonContentSms
      }, {
        path: '/cont/commonContent/mail',
        name: 'CommonContentMail',
        component: commonContentMail
      }, {
        path: '/cont/commonContent/wePage',
        name: 'CommonContentWePage',
        component: commonContentWePage
      }, {
        path: '/cont/commonContent/poster',
        name: 'CommonContentPoster',
        component: commonContentPoster
      }, {
        path: '/cont/groupContent/wx',
        name: 'GroupContentWx',
        component: groupContentWx
      }, {
        path: '/cont/groupContent/weibo',
        name: 'GroupContentWeibo',
        component: groupContentWeibo
      }, {
        path: '/cont/groupContent/sms',
        name: 'GroupContentSms',
        component: groupContentSms
      }, {
        path: '/cont/groupContent/mail',
        name: 'GroupContentMail',
        component: groupContentMail
      }, {
        path: '/cont/groupContent/wePage',
        name: 'GroupContentWePage',
        component: groupContentWePage
      }, {
        path: '/cont/groupContent/poster',
        name: 'GroupContentPoster',
        component: groupContentPoster
      }, {
        path: '/cont/releaseCheck/:mediaType',
        name: 'ReleaseCheck',
        component: releaseCheck
      }, {
        path: '/cont/releaseChecked/:mediaType',
        name: 'ReleaseChecked',
        component: releaseChecked
      },
        {
          path: '/minPage/:id',
          name: 'minPage',
          component: ActiveController,
          children: [
            {
              name: 'minPageFirst',
              path: 'first',
              component: TabFirst
            },
            {
              name: 'minPageSecond',
              path: 'second',
              component: TabSecond
            },
            {
              name: 'minPageThird',
              path: 'third',
              component: TabThird
            },
            {
              name: 'minPageFourth',
              path: 'fourth',
              component: TabFourth
            },
            {
              name: 'minPageFifth',
              path: 'fifth',
              component: TabFifth
            }
          ]
        },
        {
          path: '/formPage/:id',
          name: 'formPage',
          component: ActiveController,
          children: [
            {
              name: 'formPageFirst',
              path: 'first',
              component: TabFirst
            },
            {
              name: 'formPageSecond',
              path: 'second',
              component: TabSecond
            },
            {
              name: 'formPageThird',
              path: 'third',
              component: TabThird
            },
            {
              name: 'formPageFourth',
              path: 'fourth',
              component: TabFourth
            },
            {
              name: 'formPageFifth',
              path: 'fifth',
              component: TabFifth
            }
          ]
        }]
    }
  ],
  base: '/admin/'
})
